const fs = require('fs');
// const { resolve } = require('node:path');
// const { resolve } = require('node:path');
// fs.readFile('./aaa.md', (err, data1) => {
//     fs.readFile('./bbb.md', (err, data2) => {
//         fs.readFile('./ccc.md', (err, data3) => {
//             let data = `${data1}\r\n${data2}\r\n${data3}`;
//             console.log(data);
//         })
//     })
// })
const p = new Promise((resolve, reject) => {
    fs.readFile('./aaa.md', (err, data) => {
        resolve(data);
    });
});
p.then(value => {
    return new Promise((resolve, reject) => {
        fs.readFile('./bbb.md', (arr, data) => {
            resolve([value, data]);
        })
    })
}).then(value => {
    return new Promise((resolve, reject) => {
        fs.readFile('./ccc.md', (err, data) => {
            value.push(data);
            resolve(value);
        })
    })

}).then(value => {
    console.log(value.join('\r\n'));
})